<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">
    <title>提现</title>
    <link href="__PUBLIC__/AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/css/personal.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/css/stepstyle.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.2.min.js"></script>
    <script src="__PUBLIC__/AmazeUI-2.4.2/assets/js/amazeui.js"></script>
    <style type="text/css">
    body {
        background-color: #fff;
    }
    </style>
</head>

<body>
    <div class="center">
        <div class="col-main">
            <div class="main-wrap">
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">退货/换货</strong>
                    </div>
                </div>
                <hr/>
                <form class="am-form">
                    <input type="hidden" name="rec_id" id="rec_id" value="{$rec_id}">
                    <div class="am-form-group">
                        <label for="content" style="font-size: 18px;font-weight: bold;margin-bottom: 10px;"></label>
                        <input type="text"   id="content" placeholder="请输入原因" />
                    </div>
                    <span>当前佣金</span><span style="float: right">111</span>
                    <button type="button" onclick="returnGoods()" class="am-btn " style="margin-top:10px;width:100%;float: right;background-color: #FFAD01;">提交</button>
                </form>
            </div>
        </div>
    </div>
</body>

</html>
<script type="text/javascript" src="__PUBLIC__/layer/layer.js"></script>
<script>
    function modalInfo(info,success){
        layer.msg(info);
    }
    function returnGoods() {
        var rec_id = $('#rec_id').val();
        var content = $('#content').val();
        if(content == ''){
            modalInfo('请输入退货原因!',false);
            return;
        }
        $.ajax({
            type:'POST',
            url:"__APP__/Home/Order/returnGoods",
            dataType:'json',
            data:{
                rec_id:rec_id,
                content:content
            },
            success: function(data){
                modalInfo(data.message,data.success);
                if(data.success){
                    window.location.href='__APP__/Home/Order/change';
                }
            },
            error:function (data) {
                modalInfo('服务器繁忙！',false);
            }
        });
    }
</script>